// 云函数入口文件
const cloud = require('wx-server-sdk')
const db = wx.cloud.database();
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  console.log(event)
  try {
    return await db.collection('like').where({
      goodsId: event.goodsId,
      _openid: event._openid
    }).remove()
  } catch (e) {
    console.error(e)
  }
}